From 271eff015d5b3dc26ba2da53658bc315e3363ad0 Mon Sep 17 00:00:00 2001 From: Andre Bogus Date: Mon, 20 Feb 2017 00:45:34 +0100 Subject: [PATCH] improved formatting for bonus points --- src/cargo/sources/git/utils.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index c8676d655..877752cea 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -595,7 +595,7 @@ pub fn fetch(repo: &git2::Repository, opts.remote_callbacks(cb) .download_tags(git2::AutotagOption::All); - network::with_retry(config, ||{ + network::with_retry(config, || { remote.fetch(&[refspec], Some(&mut opts), None) })?; Ok(()) @@ -605,12 +605,12 @@ pub fn fetch(repo: &git2::Repository, /// Clone a remote repository into a target directory. This is a simple utility function to get /// HEAD. When this is complete it should be equivalent to `git clone $url $target` pub fn clone(url: &str, target: &Path, config: &Config) -> CargoResult<()> { - let repo = git2::Repository::init(target).chain_error(||{ + let repo = git2::Repository::init(target).chain_error(|| { human(format!("Failed to create template directory `{}`", target.display())) })?; let refspec = "refs/heads/*:refs/heads/*"; - fetch(&repo, url, refspec, &config).chain_error(||{ + fetch(&repo, url, refspec, &config).chain_error(|| { human(format!("failed to fecth `{}`", url)) })?; let reference = "HEAD"; -- 2.30.2